package com.example.demo.commom.timer;

import lombok.Data;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:龙宝
 * Date:2024-05-15
 * Time:9:14
 */
//任务类
@Data
public class MyTask implements Comparable<MyTask>{
    private Runnable runnable;
    private long time;
    public MyTask(Runnable runnable, long time){
        this.runnable = runnable;
        this.time = time;
    }
    public int compareTo(MyTask o){
        return (int) (this.time - o.time);
    }
}
